import request from '@/utils/request'

export const fetchScreen = (id = 2) => {
  return request({
    url: '/data/screen',
    params: {
      school_id: id
    }
  })
}

export const fetchData = params => {
  return request({
    url: '/data',
    params
  })
}

export const fetchAreas = (id = null) => {
  return request({
    url: `/data`,
    params: {
      sources: ['areas'],
      area_id: id
    }
  })
}

export const fetchFoodTypes = () => {
  return request({
    url: `/data`,
    params: {
      sources: ['foodTypes']
    }
  })
}

export const fetchFoods = () => {
  return request({
    url: `/data`,
    params: {
      sources: ['foods']
    }
  })
}

export const fetchPriceCategories = () => {
  return request({
    url: `/data`,
    params: {
      sources: ['categories']
    }
  })
}

export const fetchPermissions = () => {
  return request({
    url: `/data`,
    params: {
      sources: ['permissions']
    }
  })
}
